
<!-- 注册页 -->
<div class="top-content">
	
    <div class="inner-bg">
        <div class="container">
            <div class="row">
                <div class="col-sm-8 col-sm-offset-2 text">
                    <h1><strong>Bootstrap</strong> {{formTitle}}</h1>
                </div>
            </div>
<div class="row">
                        <div class="col-sm-6 col-sm-offset-3 form-box">
                            
                            <form role="form" action="" method="post" class="registration-form">
                                
                                <fieldset style="display: block;">
                                    <div class="form-top">
                                        <div class="form-top-left">
                                            <h3>{{formText}}</h3>
                                            <p>Tell us who you are:</p>
                                        </div>
                                        <div class="form-top-right">
                                            <i class="fa fa-user"></i>
                                        </div>
                                    </div>
                                    <div class="form-bottom">
                                        <div class="form-group">
                                            <label class="sr-only" for="form-first-name">First name</label>
                                            <input type="text" name="form-first-name" placeholder="First name..." class="form-first-name form-control" id="form-first-name">
                                        </div>
                                        <div class="form-group">
                                            <label class="sr-only" for="form-last-name">Last name</label>
                                            <input type="text" name="form-last-name" placeholder="Last name..." class="form-last-name form-control" id="form-last-name">
                                        </div>
                                        <div class="form-group">
                                            <label class="sr-only" for="form-about-yourself">About yourself</label>
                                            <textarea name="form-about-yourself" placeholder="About yourself..." class="form-about-yourself form-control" id="form-about-yourself"></textarea>
                                        </div>
                                        <button type="button" class="btn">Register!</button>
                                    </div>
                                </fieldset>
                            
                            </form>
                            
                        </div>
                    </div>
        </div>
    </div>
    
</div>

<script>

$(document).ready(function() {
    /*
        Form validation
    */
    $('.registration-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() {
        $(this).removeClass('input-error');
    });
    
    $('.registration-form').on('click', '.btn', function(e) {

        var loginFrom = $('.registration-form');
        
        loginFrom.find('input[type="text"], input[type="password"], textarea').each(function(){
            if( $(this).val() == "" ) {
                e.preventDefault();
                $(this).addClass('input-error');
            }
            else {
                $(this).removeClass('input-error');
            }
        });

        if(loginFrom.find('.input-error').length == 0) {
            location.href = 'success.html';
        }
        
    });
    
});

</script>